﻿<UserControl
    x:Class="ColorWheel.Silverlight.Slider.Demo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:cwc="clr-namespace:ColorWheel.Controls;assembly=ColorWheel.Controls"
    xmlns:global="clr-namespace:ColorWheel.Core;assembly=ColorWheel.Core"
    xmlns:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <UserControl.Resources>
        <ResourceDictionary>

            <global:ColorToBrush
                x:Key="ColorToBrush" />

        </ResourceDictionary>
    </UserControl.Resources>

    <Grid
        Background="Gray">


        <Grid
            VerticalAlignment="Center"
            HorizontalAlignment="Center"
            Height="622"
            Width="527"
            Background="Gray">

            <Button
                VerticalAlignment="Top"
                HorizontalAlignment="Left"
                Margin="267,12,0,0"
                Height="30"
                Click="Button_Click_1"
                Content="Random Color 1"
                Width="108"></Button>

            <Button
                VerticalAlignment="Top"
                HorizontalAlignment="Left"
                Margin="381,12,0,0"
                Height="30"
                Click="Button_Click"
                Content="Random Color 2"
                Width="110"></Button>

            <sdk:Label
                Content="Red"
                Height="28"
                HorizontalAlignment="Left"
                Margin="12,46,0,0"
                Name="label1"
                VerticalAlignment="Top"
                Width="50"
                Foreground="White" />

            <sdk:Label
                Content="Green"
                Height="28"
                HorizontalAlignment="Left"
                Margin="12,81,0,0"
                Name="label2"
                VerticalAlignment="Top"
                Width="50"
                Foreground="White" />

            <sdk:Label
                Content="Blue"
                Height="28"
                HorizontalAlignment="Left"
                Margin="12,117,0,0"
                Name="label3"
                VerticalAlignment="Top"
                Width="50"
                Foreground="White" />

            <cwc:ColorComponentSlider
                VerticalAlignment="Top"
                x:Name="slider"
                Minimum="0"
                Maximum="255"
                Height="28"
                SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
                SliderColorComponent="R"
                Value="{Binding CurrentColor.R, Mode=TwoWay}"
                Margin="100,48,12,499" />

            <cwc:ColorComponentSlider
                VerticalAlignment="Top"
                Margin="100,84,12,463"
                Name="slider1"
                Minimum="0"
                Maximum="255"
                Height="28"
                SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
                Value="{Binding CurrentColor.G, Mode=TwoWay}"
                SliderColorComponent="G" />

            <cwc:ColorComponentSlider
                VerticalAlignment="Top"
                Margin="100,120,12,427"
                Name="slider2"
                Minimum="0"
                Maximum="255"
                Height="28"
                SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
                Value="{Binding CurrentColor.B, Mode=TwoWay}"
                SliderColorComponent="B" />

            <Rectangle
                Height="276"
                HorizontalAlignment="Left"
                Fill="{Binding CurrentColor.RgbColor, Converter={StaticResource ColorToBrush}, Mode=OneWay}"
                Margin="14,295,0,0"
                Name="rectangle1"
                Stroke="White"
                VerticalAlignment="Top"
                Width="477" />

            <sdk:Label
                Content="Saturation"
                Foreground="White"
                Height="28"
                HorizontalAlignment="Left"
                Margin="12,154,0,0"
                Name="label4"
                VerticalAlignment="Top"
                Width="82" />

            <cwc:ColorComponentSlider
                VerticalAlignment="Top"
                Margin="100,156,12,391"
                Maximum="255"
                Minimum="0"
                Height="28"
                Name="slider3"
                SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
                SliderColorComponent="Sat"
                Value="{Binding CurrentColor.Saturation255, Mode=TwoWay}" />

            <sdk:Label
                Content="Brightness"
                Foreground="White"
                Height="28"
                HorizontalAlignment="Left"
                Margin="12,190,0,0"
                Name="label5"
                VerticalAlignment="Top"
                Width="82" />

            <cwc:ColorComponentSlider
                VerticalAlignment="Top"
                Margin="100,192,12,355"
                Maximum="255"
                Minimum="0"
                Height="28"
                Name="slider4"
                SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
                SliderColorComponent="Bri"
                Value="{Binding CurrentColor.Brightness255, Mode=TwoWay}" />

            <sdk:Label
                Content="Hue"
                Foreground="White"
                Height="28"
                HorizontalAlignment="Left"
                Margin="12,226,0,0"
                Name="label6"
                VerticalAlignment="Top"
                Width="82" />

            <cwc:ColorComponentSlider
                VerticalAlignment="Top"
                Margin="100,228,12,319"
                Maximum="359.99"
                Minimum="0"
                Height="28"
                Name="slider6"
                SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
                SliderColorComponent="Hue"
                ColorWheel="{Binding Palette, Mode=OneWay}"
                Value="{Binding CurrentColor.Hue360, Mode=TwoWay}" />

            <sdk:Label
                Content="Transparancy"
                Foreground="White"
                Height="28"
                HorizontalAlignment="Left"
                Margin="12,261,0,0"
                Name="label7"
                VerticalAlignment="Top"
                Width="91" />

            <cwc:ColorComponentSlider
                VerticalAlignment="Top"
                ColorWheel="{Binding Palette, Mode=OneWay}"
                Margin="100,263,12,284"
                Maximum="255"
                Height="28"
                Minimum="0"
                Name="slider7"
                SliderColor="{Binding CurrentColor.RgbColor, Mode=OneWay}"
                SliderColorComponent="Alpha"
                Value="{Binding CurrentColor.Alpha255, Mode=TwoWay}" />
        </Grid>
    </Grid>
</UserControl>
